namespace SPI.AgentServer.Models;

public class TableSchema
{
    public string DatabaseName { get; set; } = string.Empty;
    public string TableName { get; set; } = string.Empty;
    public string SchemaName { get; set; } = "dbo";
    public List<ColumnSchema> Columns { get; set; } = new();
    public List<string> PrimaryKeys { get; set; } = new();
    public string? Description { get; set; }
    public Dictionary<string, object> Metadata { get; set; } = new();
}

public class ColumnSchema
{
    public string ColumnName { get; set; } = string.Empty;
    public string DataType { get; set; } = string.Empty;
    public int? MaxLength { get; set; }
    public bool IsNullable { get; set; }
    public bool IsPrimaryKey { get; set; }
    public bool IsIdentity { get; set; }
    public string? DefaultValue { get; set; }
    public string? Description { get; set; }
}

public class DatabaseSchema
{
    public string DatabaseName { get; set; } = string.Empty;
    public string Provider { get; set; } = string.Empty;
    public List<TableSchema> Tables { get; set; } = new();
    public DateTime LastUpdated { get; set; }
}
